import Operator from "./Operator";
import {RC} from "../config/RC"
import bcryptjs from "bcryptjs"

class EncryptPasswordOperator extends Operator{
    public async execute(): Promise<RC> {
        let password: string = this.args.getProperty('password')
        let encryptedPassword: string = bcryptjs.hashSync(password, 10);
        this.args.setProperty('encryptedPassword', encryptedPassword)
        return RC.SUCCESS;
    }
}

export default EncryptPasswordOperator;